namespace System.Xml.Serialization
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.Xml;
    using Internal;

    [Serializable]
    public abstract class XmlTypeSettings : IXmlRuntimeSerializerInternal, IXmlTypeSerializer, IXmlTypeFormatterInternal, IXmlTypeFormatter
    {
        [NonSerialized]
        private Type _type;

        protected XmlTypeSettings(Type type)
        {
            this._type = type;
        }

        internal abstract void CreateRuntimeSerializer(bool generateNew);
        internal abstract IXmlFormatAttributesInternal InternalAttributes { get; }
        internal abstract XmlSerializer InternalSerializer { get; }
        internal abstract XmlReaderSettings InternalReaderSettings { get; }
        internal abstract XmlWriterSettings InternalWriterSettings { get; }

        public Type RuntimeType { get { return this._type; } }

        [SuppressMessage("Microsoft.Design", "CA1033")]
        XmlReaderSettings IXmlTypeSerializer.ReaderSettings { get { return this.InternalReaderSettings; } }
        [SuppressMessage("Microsoft.Design", "CA1033")]
        XmlWriterSettings IXmlTypeSerializer.WriterSettings { get { return this.InternalWriterSettings; } }
        [SuppressMessage("Microsoft.Design", "CA1033")]
        IXmlFormatAttributes IXmlTypeSerializer.Attributes { get { return this.InternalAttributes; } }


        XmlSerializer IXmlRuntimeSerializerInternal.RuntimeSerializer { get { return this.InternalSerializer; } }

        IXmlFormatAttributesInternal IXmlRuntimeSerializerInternal.InternalAttributes { get { return this.InternalAttributes; } }

        void IXmlRuntimeSerializerInternal.CreateRuntimeSerializer(bool generateNew) { this.CreateRuntimeSerializer(generateNew); }

        IXmlRuntimeSerializerInternal IXmlTypeFormatterInternal.InternalSerializer { get { return this; } }

        public IXmlTypeSerializer Serializer { get { return this; } }
    }
}

